; ModuleID = 'while.c'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"

define i32 @foo() nounwind {
entry:
  %retval = alloca i32                            ; <i32*> [#uses=2]
  %0 = alloca i32                                 ; <i32*> [#uses=2]
  %i = alloca i32                                 ; <i32*> [#uses=5]
  %j = alloca i32                                 ; <i32*> [#uses=2]
  %k = alloca i32                                 ; <i32*> [#uses=2]
  %m = alloca i32                                 ; <i32*> [#uses=4]
  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
  store i32 10, i32* %i, align 4
  store i32 5, i32* %j, align 4
  store i32 8, i32* %k, align 4
  store i32 1, i32* %m, align 4
  br label %bb5

bb:                                               ; preds = %bb5, %bb3
  store i32 7, i32* %k, align 4
  br label %bb2

bb1:                                              ; preds = %bb2
  %1 = load i32* %i, align 4                      ; <i32> [#uses=1]
  %2 = add nsw i32 %1, 1                          ; <i32> [#uses=1]
  store i32 %2, i32* %i, align 4
  br label %bb2

bb2:                                              ; preds = %bb1, %bb
  %3 = load i32* %i, align 4                      ; <i32> [#uses=1]
  %4 = icmp sgt i32 %3, 0                         ; <i1> [#uses=1]
  br i1 %4, label %bb1, label %bb3

bb3:                                              ; preds = %bb2
  %5 = load i32* %j, align 4                      ; <i32> [#uses=1]
  %6 = icmp sgt i32 %5, 0                         ; <i1> [#uses=1]
  br i1 %6, label %bb, label %bb4

bb4:                                              ; preds = %bb3
  %7 = load i32* %m, align 4                      ; <i32> [#uses=1]
  %8 = add nsw i32 %7, 1                          ; <i32> [#uses=1]
  store i32 %8, i32* %m, align 4
  br label %bb5

bb5:                                              ; preds = %bb4, %entry
  %9 = load i32* %m, align 4                      ; <i32> [#uses=1]
  %10 = icmp sle i32 %9, 99                       ; <i1> [#uses=1]
  br i1 %10, label %bb, label %bb6

bb6:                                              ; preds = %bb5
  %11 = load i32* %i, align 4                     ; <i32> [#uses=1]
  store i32 %11, i32* %0, align 4
  %12 = load i32* %0, align 4                     ; <i32> [#uses=1]
  store i32 %12, i32* %retval, align 4
  br label %return

return:                                           ; preds = %bb6
  %retval7 = load i32* %retval                    ; <i32> [#uses=1]
  ret i32 %retval7
}
